<?php

class MineReceiveAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT
    );

    /**
     * 矿洞开采收矿
     *
     * @param $userId
     * @param $reqTime
     * @return SzResponse
     */
    public function execute($userId, $reqTime)
    {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_MINE_FUNC)) {
            return $this->buildResponse(false);
        }

        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);

        return $this->buildResponse(array(
            MineService::get()->receive($userId)
        ));
    }
}